#ifndef SPINBOXWITHSLIDER_H
#define SPINBOXWITHSLIDER_H

#include <QWidget>
#include <QLabel>
#include <QSpinBox>
#include <QSlider>
#include <QLayout>

class SpinBoxWithSlider : public QWidget
{
Q_OBJECT
public:
    explicit SpinBoxWithSlider(const QString& title, int currentValue = 0, int minValue = 0, int maxValue = 100, QWidget* parent = nullptr);
    ~SpinBoxWithSlider() override;

    void SetMinValue(int v);
    void SetMaxValue(int v);
    void SetTitle(const QString& title);
    int GetValue();

public slots:
    void SetValue(int v);

signals:
    void ValueChanged(int v);

private:
    QLabel* label;
    QSpinBox* box;
    QSlider* slider;
    QHBoxLayout* layout;

private:
    int max;
    int min;
    int current;

private slots:
    void ValueChangedHandle(int v);
};


#endif //SPINBOXWITHSLIDER_H
